package com.dsg.service.Impl;

import com.dsg.entity.*;
import com.dsg.mappers.ServiceMapper;
import com.dsg.service.ServiceService;
import com.dsg.vo.PageResult;
import com.dsg.vo.SerDto;
import com.github.pagehelper.PageHelper;

import javax.annotation.Resource;
import java.util.List;
@org.springframework.stereotype.Service("ServiceService")
public class ServiceServiceImpl implements ServiceService {
    @Resource
    private ServiceMapper serviceMapper;
    @Override
    public List<Service> seachServiceAll() {
        return serviceMapper.findServiceAll();
    }

    @Override
    public PageResult seachPagination(Integer offset,Integer limit,SerDto serDto) {
        PageHelper.offsetPage(offset,limit);
        List<Service> list= serviceMapper.findByDto(serDto);
        return new PageResult(list);
    }

    @Override
    public List<Servicetype> seachType() {
        return serviceMapper.findTypeAll();
    }

    @Override
    public List<Fuwustart> seachStart() {
        return serviceMapper.findStartAll();
    }

    @Override
    public void delService(Integer[] ids) {
        serviceMapper.delService(ids);
    }

    @Override
    public int update(Service service) {
        return serviceMapper.update(service);
    }

    @Override
    public int add(Service service) {
        return serviceMapper.add(service);
    }

    @Override
    public List<Customer> seachcusName() {
        return serviceMapper.findcusName();
    }

    public List<Staff> seachAllYg(){
        return serviceMapper.findYuangong();
    }


    @Override
    public int updateStart(int i) {
        return serviceMapper.updateStart(i);
    }

    @Override
    public void updateFankui(Integer[] ids) {
        serviceMapper.updateFanKui(ids);
    }

    @Override
    public int updatefenpei(Service service) {
        return serviceMapper.updatefenpei(service);
    }

    @Override
    public int updatechuli(Service service) {
        return serviceMapper.updatechuli(service);
    }
}
